<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet"
			href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class='full-center-content-scroll-noheader'>
			<h:form id="sessionManagerForm">
				<p:growl id="msgs" showDetail="true" />
				<div class="box box-solid with-border">
					<p:dataTable id="sessionTable"
						value="#{sessionController.sessionDTOList}" var="s"
						paginator="true" emptyMessage="无记录" rowKey="#{session.sessionId}"
						rowIndexVar="ite" sortBy="#{s.dept}" rows="20"
						paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="20,50,100" paginatorPosition="bottom"
						style="text-align:center;margin-top:3px">
						<f:facet name="{Customization}">
							<p:outputLabel
								value="总计：#{sessionController.sessionDTOList.size()} 条记录"
								style="margin-right:20px;" />
						</f:facet>
						<p:column width="5%" headerText="序号 ">
							<h:outputText value="#{ite+1}" />
						</p:column>
						<p:column headerText="所在部门">
							<h:outputText value="#{s.dept}" />
						</p:column>
						<p:column headerText="当前会话">
							<h:outputText value="#{s.name}" />
						</p:column>
						<p:column headerText="上次登录时间">
							<h:outputText value="#{s.lastVisitTime}">
								<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
							</h:outputText>
						</p:column>
						<p:column>
							<p:commandLink value="移除" process="@this" id="removeSession"
								style="margin-left:5px;color:red;text-decoration:underline"
								update="sessionManagerForm:sessionTable sessionManagerForm:msgs"
								rendered="#{s:hasPermission(session,'xtsz_xtqx_hhgl_yc')}"
								actionListener="#{sessionController.removeSession(s.sessionId)}">
								<p:confirm header="提示" message="确定移除该用户吗?" icon="ui-icon-alert" />
							</p:commandLink>
						</p:column>
					</p:dataTable>
				</div>
			</h:form>
		</div>
	</ui:define>
</ui:composition>